package cn.cloudtogo.common.types;

import cn.cloudtogo.common.Assert;
import lombok.Data;

/**
 * @author yaolianhua789@gmail.com
 **/
@Data
public class Credential {
    private String user;
    private String password;

    public static Credential of(String user, String password) {
        Assert.argument(user != null && !user.isEmpty(), () -> "user is null");
        Assert.argument(password != null && !password.isEmpty(), () -> "password is null");
        Credential credential = new Credential();

        credential.setUser(user);
        credential.setPassword(password);

        return credential;
    }
}
